package net.pimpas.web.jsf.renderers.message.html;

import java.io.IOException;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;

import org.apache.myfaces.shared_impl.renderkit.html.HtmlMessageRendererBase;

public class HtmlMessageRenderer extends HtmlMessageRendererBase {
	
	@Override
	public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
		super.encodeEnd(facesContext, component);
		renderMessage(facesContext, component, true);
	}

	@Override
	protected String getDetail(FacesContext facesContext, UIComponent message, FacesMessage facesMessage, String msgClientId) {
		return facesMessage.getDetail();
	}

	@Override
	protected String getSummary(FacesContext facesContext, UIComponent message, FacesMessage facesMessage, String msgClientId) {
		return facesMessage.getSummary();
	}
}